﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace theoozS3Browser
{
    public partial class MainPage : PhoneApplicationPage
    {
        string sAccessKey = "enter access key";
        string sSecretKey = "enter secret key";
        byte alpha = 150;

        public MainPage()
        {
            InitializeComponent();

            SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;

            txtAccessKey.Foreground = new SolidColorBrush(Color.FromArgb(alpha, 0, 0, 0));
            txtSecretKey.Foreground = new SolidColorBrush(Color.FromArgb(alpha, 0, 0, 0));
        }

        private void txtAccessKey_GotFocus(object sender, RoutedEventArgs e)
        {
            if (txtAccessKey.Text == sAccessKey)
            {
                txtAccessKey.Text = "";
                txtAccessKey.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
            }
        }

        private void txtAccessKey_LostFocus(object sender, RoutedEventArgs e)
        {
            if (txtAccessKey.Text == "")
            {
                txtAccessKey.Text = sAccessKey;
                txtAccessKey.Foreground = new SolidColorBrush(Color.FromArgb(alpha, 0, 0, 0));
            }
        }

        private void txtSecretKey_GotFocus(object sender, RoutedEventArgs e)
        {
            if (txtSecretKey.Text == sSecretKey)
            {
                txtSecretKey.Text = "";
                txtSecretKey.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
            }
        }

        private void txtSecretKey_LostFocus(object sender, RoutedEventArgs e)
        {
            if (txtSecretKey.Text == "")
            {
                txtSecretKey.Text = sSecretKey;
                txtSecretKey.Foreground = new SolidColorBrush(Color.FromArgb(alpha, 0, 0, 0));
            }
        }

        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}